package cn.web.tunnelrobot.dao;

import cn.web.tunnelrobot.dto.EarlyWarning;
import cn.web.tunnelrobot.dto.HardwareTestInfoDTO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 硬件检测信息dao层
 * @Author：lichaung
 */
public interface HardwareTestInfoDao {
    //根据项目ID和里程查询硬件检测信息
    List<HardwareTestInfoDTO> getHardwareTestInfoByPrIdAndMileage(@Param("prId") Integer prId, @Param("htTurnMeter1") String htTurnMeter1,@Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize);
    List<HardwareTestInfoDTO> getHardwareTestInfoByRange(@Param("prId") Integer prId, @Param("beginHtMileage") Integer beginHtMileage,@Param("endHtMileage") Integer endHtMileage,@Param("pageNo") Integer pageNo,@Param("pageSize") Integer pageSize);

    //查询条数
    int getHardwareTestInfoByPrIdAndMileageCount(@Param("prId") Integer prId, @Param("htTurnMeter1") String htTurnMeter1);

    int getHardwareTestInfoByRangeCount(@Param("prId") Integer prId, @Param("beginHtMileage") Integer beginHtMileage,@Param("endHtMileage") Integer endHtMileage);
    //根据项目ID和里程查询硬件累计收敛、沉降数据(近七天的所有数据)
    HardwareTestInfoDTO  getHardwareTestInfoData(@Param("prId") Integer prId, @Param("htMileage") Integer htMileage);
    //添加硬件采集信息
    int addHardwareTestInfoDTO(HardwareTestInfoDTO hardwareTestInfoDTO);
    //更新硬件采集信息
    int updateHardwareTestInfoDTO(HardwareTestInfoDTO hardwareTestInfoDTO);
    //查询最后一次录入的数据(进行沉降、收敛值对比)  携带里程和云转向角度  type 0沉降 1收敛
    HardwareTestInfoDTO getLastHardwareTestInfoDTO(Integer htMileage,Float htAngle,Integer type);
    //信息汇总页面==>验收次数
    int getInformationInputCount(String operStartTime,String operEndTime);
    //获取近一个月的隧道检测信息
    List<HardwareTestInfoDTO> getHardwareTestInfo(@Param("prId") Integer prId,
                                                  @Param("htMileage") Integer htMileage,
                                                  @Param("htDailySettl1") Float htDailySettl1,
                                                  @Param("htDailySettl2") Float htDailySettl2,
                                                  @Param("htDailyConvergence1") Float htDailyConvergence1,
                                                  @Param("htDailyConvergence2") Float htDailyConvergence2,
                                                  @Param("time1") Date time1, @Param("time2") Date time2,
                                                  @Param("pageNo")Integer pageNo,
                                                  @Param("pageSize")Integer pageSize);

    int getHardwareTestInfoCount(@Param("prId") Integer prId,
                                 @Param("htMileage") Integer htMileage,
                                 @Param("htDailySettl1") Float htDailySettl1,
                                 @Param("htDailySettl2") Float htDailySettl2,
                                 @Param("htDailyConvergence1") Float htDailyConvergence1,
                                 @Param("htDailyConvergence2") Float htDailyConvergence2,
                                 @Param("time1") Date time1, @Param("time2") Date time2);
    //获取隧道检测信息
    List<HardwareTestInfoDTO> getHardwareTestexport1(@Param("prId") Integer prId,
                                                   @Param("htMileage1") Integer htMileage1,
                                                   @Param("htMileage2") Integer htMileage2,
                                                   @Param("htDailySettl1") Float htDailySettl1,
                                                   @Param("htDailySettl2") Float htDailySettl2,
                                                   @Param("htDailyConvergence1") Float htDailyConvergence1,
                                                   @Param("htDailyConvergence2") Float htDailyConvergence2,
                                                   @Param("time1") Date time1, @Param("time2") Date time2);
    //获取隧道检测信息
    List<HardwareTestInfoDTO> getHardwareTestInfo1(@Param("prId") Integer prId,
                                                  @Param("htMileage1") Integer htMileage1,
                                                  @Param("htMileage2") Integer htMileage2,
                                                  @Param("htDailySettl1") Float htDailySettl1,
                                                  @Param("htDailySettl2") Float htDailySettl2,
                                                  @Param("htDailyConvergence1") Float htDailyConvergence1,
                                                  @Param("htDailyConvergence2") Float htDailyConvergence2,
                                                  @Param("time1") Date time1, @Param("time2") Date time2,
                                                  @Param("pageNo")Integer pageNo,
                                                  @Param("pageSize")Integer pageSize);

    int getHardwareTestInfoCount1(@Param("prId") Integer prId,
                                  @Param("htMileage1") Integer htMileage1,
                                  @Param("htMileage2") Integer htMileage2,
                                 @Param("htDailySettl1") Float htDailySettl1,
                                 @Param("htDailySettl2") Float htDailySettl2,
                                 @Param("htDailyConvergence1") Float htDailyConvergence1,
                                 @Param("htDailyConvergence2") Float htDailyConvergence2,
                                 @Param("time1") Date time1, @Param("time2") Date time2);

    //获取累计沉降值
    float getLastHardwareTestInfoDTOSum1(@Param("htMileage")Integer htMileage, @Param("htAngle")Float htAngle,@Param("type")Integer type);
    //获取累计收敛值
    float getLastHardwareTestInfoDTOSum2(@Param("htMileage")Integer htMileage, @Param("htAngle")Float htAngle,@Param("type")Integer type);

    //近5次沉降收敛值
    List<HardwareTestInfoDTO> getAllFive();

    //近5次累计沉降收敛值
    List<HardwareTestInfoDTO> getNowFive();
}
